﻿@model IEnumerable<EnrollSummaryModel>
@{
    ViewBag.Title = "培训报名记录";
}
<form method="GET" role="form">
    <ul>
        <li>
            <input name="idCard" placeholder="报名时填写的身份证" maxlength="18" required="" value="@ViewBag.idCard"/>
        </li>
        <li>
            <input name="phone" placeholder="报名时填写的手机号" maxlength="11" required="" type="tel" value="@ViewBag.phone"/>
        </li>
        <li>
            <input name="start" placeholder="报名日期 自"  required="" type="date" value="@ViewBag.start.ToString("yyyy-MM-dd")"/>
        </li>
        <li>
            <input name="end" placeholder="报名日期 到" required="" type="date" value="@ViewBag.end.ToString("yyyy-MM-dd")"/>
        </li>
        <li style="margin-top: 20px;text-align: center">
            <input type="submit" value="查 询" id="submit"/>
        </li>
    </ul>
</form>
<p style="color: red;text-align:center">@ViewBag.Error</p>
@if (Model != null && !Model.Any())
{
    <p style="text-align: center">没有查询到数据</p>
}
else if(Model != null)
{
    <ul id="result">
        @foreach (var item in Model)
        {
            var statusClass = "";
            switch (item.Status)
            {
                case "通过":
                    statusClass = "text-green";
                    break;
                case "未通过":
                    statusClass = "text-red";
                    break;
            }
            <li>
                <dl>
                    <dt>姓名</dt>
                    <dd>@item.Name</dd>
                    <dt>培训项目</dt>
                    <dd>@item.TrainningName</dd>
                    <dt>报名时间</dt>
                    <dd>@item.CreateTime.ToString("yyyy-MM-dd HH:mm")</dd>
                    <dt>审核状态</dt>
                    <dd class="@statusClass">@item.Status</dd>
                    <dt>审核说明</dt>
                    <dd class="@statusClass">@Html.Raw(string.IsNullOrEmpty(item.StatusDescription) ? "无" : item.StatusDescription)</dd>
                </dl>
            </li>
        }
    </ul>
}
@section css
{
    <style>
          body{background:#57A3C9}
         a,a:visited,a:link{color: white}
         form>ul>li {
             text-align: center;
         }
        form>ul>li>input {
            margin: auto;
        }
        li {
            margin: 10px;
        }
         .text-green {
            color: green;
        }

        .text-red {
            color: red;
        }
        #result > li {
            border: 1px solid grey;
            border-width: 1px 0 0 0;
        }

        input, select {
            margin: auto;
            width: 90%;
            height: 40px;
            border-radius: 5px;
            font-size: 20px;
            padding-left: 10px;
        }

        #submit {
            padding: 8px 15px;
            border-radius: 5px;
            border: 2px solid white;
            background: transparent;
            color: white;
            width: 94%;
            margin: auto;
        }

        dl{ color: white }
        dd {font-size: 18px;margin: 5px 0 15px 0;word-wrap: break-word}

        @@media (max-width: 360px) {
            input, select {
                height: 30px;
                font-size: 16px;
            }
        }
    </style>
}